<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, target-densitydpi=360">
    <title>JSBridge测试网页</title>
    <script src="./dsbridge.js"></script>
</head>
<body style="background-color: #009688">
<div>
    <input type="button"
           style="color:white;
       width:100px;
       height:50px;
       background-color:#6495ed"
           value="获取版本号"
           onclick="senMessage()"/>

    <div id="main" style="color:white"></div>

</div>
<script>

    dsBridge.register('fromAndroid', function (value) {
        document.getElementById("main").innerText = "接收到Android的消息:\n" + value
        return "我是JS返回的消息";
    })

    function senMessage() {
        dsBridge.call("getVersionCode", null, function (value) {
            alert(value)
        })
    }


</script>
</body>
</html>
